﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pgSRecepcionProceso.aspx.cs" Inherits="EGuayas.Web.EGlobal.pgSubDirector" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="~/EGlobal/ucInfoDocumentos.ascx"  TagPrefix="uc1" TagName="ucInfoDocumentos" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link  href="~/Resources/css/Style.css"  rel="stylesheet" />
    <!-- Load Ext JS --> 
    <script src="../../Resources/js/Global.js"></script>
   
</head>
<body>  
    <form id="Form1" runat="server"> 
        <ext:ResourceManager ID="pgIdCategManager" runat="server" />
         <uc1:ucInfoDocumentos runat="server" id="ucInfoDocumentos" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
            <Items>  
              <ext:FormPanel ID="FormPanel4" runat="server" Region="Center" Layout="VBoxLayout">
                <LayoutConfig>
                    <ext:VBoxLayoutConfig Align="Stretch" />
                </LayoutConfig> 
                   <Items>       
            <%--:: Venana popup --%>
            <ext:Window
            ID="winProceso"
            runat="server"
            Height="400"
            Width="850"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;"
            BodyPadding="5"
            Hidden="true"
            CloseAction="Hide"
            Plain="true"                 
            HeaderPosition="Bottom"
            Layout="BorderLayout">
            <Items>                
                <ext:FormPanel
                    ID="forPanelProc"
                    Region="Center"
                    Split="true"
                    runat="server"                              
                    BodyPadding="5"
                    Icon="ApplicationEdit"                  
                    Layout="FitLayout">
                    <FieldDefaults LabelWidth="75" LabelPad="20" LabelSeparator="" />
                    <Items>
                        <ext:Panel ID="Panel3" runat="server" Border="false" Layout="Form" ColumnWidth=".5" LabelAlign="Top">
                            <Defaults>                             
                                <ext:Parameter Name="MsgTarget" Value="side" />
                            </Defaults>
                            <Items>       
                                 <ext:Hidden Text="" ID="hdId" Name="Id" runat="server"></ext:Hidden>
                                 <ext:TextField  runat="server" Name="ExpedienteNombre" ReadOnly="true" FieldLabel="Expediente"></ext:TextField>                          
                                 <ext:TextField runat="server" Name="FaseNombre" ReadOnly="true" FieldLabel="Fase"></ext:TextField>                      
                                  <ext:ComboBox ID="cbbJefatura" runat="server"  FieldLabel="Estado" Name="JefeturaCodigo">
                                         <Items>
                                                <ext:ListItem Text="Licenciamiento"  Value ="LICENCIAMIENTO"></ext:ListItem>
                                                <ext:ListItem Text="Auditoria" Value="AUDITORIA"></ext:ListItem>
                                         </Items>
		                                <Triggers>
			                                <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
		                                </Triggers>
		                                <Listeners>
			                                <Select Handler="this.getTrigger(0).show();" />
			                                <BeforeQuery Handler="this.getTrigger(0)[this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
			                                <TriggerClick Handler="if (index == 0) { 
		                                   this.clearValue(); 
		                                   this.getTrigger(0).hide();
	                                   }" />
		                                </Listeners>
	                            </ext:ComboBox>
                                 <ext:TextArea runat="server" ID="txtCometarioRevizar"   AllowBlank="false" FieldLabel="Detalle" Height="190" AutoScroll="true"></ext:TextArea>
                            </Items>                     
                         </ext:Panel>
                    </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnAprobar}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>

            </Items>
            <Buttons>
                <ext:Button ID="btnAprobar" runat="server" Text="Asignar" Disabled="true"  
                    FormBind="true">
                    <DirectEvents>                       
                        <Click OnEvent="btnModificar_Click" After="AppGlobalJs.closeWin(#{winProceso})">
                            <ExtraParams>
                                <ext:Parameter Name="Id" Value="#{hdId}.getValue()" Mode="Raw" />
                                <ext:Parameter Name="Jefatura" Value="#{cbbJefatura}.getValue()" Mode="Raw" />
                                <ext:Parameter Name="Detalle" Value="#{txtCometarioRevizar}.getValue()" Mode="Raw" /> 
                            </ExtraParams>
                            <EventMask ShowMask="true"></EventMask>                         
                        </Click>                        
                    </DirectEvents>
                </ext:Button>
                <ext:Button ID="btnCancelar" runat="server" Text="Cancelar" OnClientClick="AppGlobalJs.closeWin(#{winProceso})">
                    <Listeners>
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelProc}.getForm().reset();"></BeforeHide>
            </Listeners>
        </ext:Window>
           
            <ext:TabPanel ID="TabPanel1" runat="server"  Flex="1">
                <Items>
                     <ext:FormPanel ID="FormPanel1" runat="server" Region="Center" Layout="Fit"     Title  ="Documentos a Revizar" 
                                    Icon        ="PageWhiteStack" >                           
                                    <Items>  
                             
                                                <ext:GridPanel
                                                    ID="gpDocumentosLoad"
                                                    runat="server"                                           
                                                    Height="90">
                                                    <Store>
                                                        <ext:Store ID="Store2" runat="server">
                                                            <Model>
                                                                <ext:Model ID="Model2" runat="server" IDProperty="Id">
                                                                    <Fields>
                                                                        <ext:ModelField Name="Fecha" Type="Date" />
                                                                        <ext:ModelField Name="ExpedienteId" Type="String" />
                                                                        <ext:ModelField Name="ExpedienteNombre" Type="String" />
                                                                        <ext:ModelField Name="FaseNombre" Type="String" />
                                                                        <ext:ModelField Name="FaseId" Type="String" />
                                                                        <ext:ModelField Name="JefeturaNombre" Type="String" />
                                                                        <ext:ModelField Name="JefeturaCodigo" Type="String" />  
                                                                        <ext:ModelField Name="Tabla" Type="String" />
                                                                        <ext:ModelField Name="TablaId" Type="String" />                                                            
                                                                    </Fields>
                                                                </ext:Model>
                                                            </Model>                                      
                                                            <Proxy>
                                                                <ext:PageProxy DirectFn="App.direct.BindDataAsignados">
                                                                    <Reader>
                                                                        <ext:JsonReader></ext:JsonReader>
                                                                    </Reader>
                                                                </ext:PageProxy>
                                                            </Proxy>
                                                        </ext:Store>
                                                    </Store>
                                                    <ColumnModel ID="ColumnModel2" runat="server">
                                                        <Columns>
                                                            <ext:Column ID="Column1"  runat="server" Text="Id" DataIndex="Id" Flex="1" Hidden="true"/>
                                                            <ext:DateColumn ID="DateColumn3" runat="server" Text="Fecha" Width="95" DataIndex="Fecha" Format="dd-m-yy" />                                                        
                                                            <ext:Column  runat="server" Text="Expediente" DataIndex="ExpedienteNombre" Flex="1"/>
                                                            <ext:Column  runat="server" Text="Fase" DataIndex="FaseNombre" /> 
                                                            <ext:Column ID="Column11" runat="server">
                                                                <Commands>
                                                                    <ext:ImageCommand CommandName="RevApro" Icon="PageWhiteRefresh" Text="Documentos">                                                                
                                                                    </ext:ImageCommand>
                                                                </Commands>
                                                               
                                                                <Listeners>
                                                                    <Command Handler="pgFn.ShwoAllDoc(record);"></Command>
                                                                </Listeners>
                                                            </ext:Column>                                                            
                                                            
                                                            <ext:Column ID="Column12" runat="server">
                                                                <Commands>
                                                                    <ext:ImageCommand CommandName="RevApro" Icon="ApplicationEdit" Text="Asignar">                                                                
                                                                    </ext:ImageCommand>
                                                                </Commands>
                                                               
                                                                <Listeners>
                                                                    <Command Handler="pgFn.ShowProc(record);"></Command>
                                                                </Listeners>
                                                            </ext:Column>                                                             
                                                            <ext:Column ID="Column6" runat="server">
                                                                <Commands>
                                                                    <ext:ImageCommand CommandName="VerExp" Icon="ZoomOut" Text="Ver Expediente">                                                                
                                                                    </ext:ImageCommand>
                                                                </Commands>
                                                               
                                                                <Listeners>
                                                                    <Command Handler="pgFn.ShowExp(record);"></Command>
                                                                </Listeners>
                                                            </ext:Column>                                                                              
                                                        </Columns>                                                    
                                                    </ColumnModel>    
                                                     <Features>
                                                            <ext:GridFilters runat="server" ID="GridFilters1" Local="true" MenuFilterText="Filtrar por">
                                                                <Filters>
                                                                    <ext:StringFilter DataIndex="ExpedienteNombre"  EmptyText="Nombre"/>
                                                                    <ext:StringFilter DataIndex="FaseNombre" EmptyText="Fase"/>
                                                                    <ext:DateFilter   DataIndex="Fecha" AfterText="Despues de" BeforeText="Antes de"  OnText="En" >
                                                                        <DatePickerOptions runat="server" TodayText="Ahora" />
                                                                    </ext:DateFilter>                                                            
                                                                   
                                                                </Filters>
                                                            </ext:GridFilters>
                                                    </Features>                                                                                                           
                                                </ext:GridPanel>                                                  
                          
                                    </Items>
                       
                           <BottomBar>
                             <ext:StatusBar 
                                    ID="StatusBar2" 
                                    runat="server"
                                    StatusAlign="Left">
                                    <Items>                                
                                        <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="" Cls="ux-bold-text-item"  Margin="15"/>
                                    </Items>
                                </ext:StatusBar>
                            </BottomBar>
                    </ext:FormPanel>
                     <ext:FormPanel ID="FormPanel2" runat="server" Region="Center" Layout="Fit"  Title  ="Documentos Enviados" 
                                Icon        ="BookOpenMark" >                       
                                <Items>                                    
                             
                                            <ext:GridPanel
                                                ID="gpEnviados"
                                                runat="server"                                           
                                                Height="90">
                                                 <Store>
                                                        <ext:Store ID="Store1" runat="server">
                                                            <Model>
                                                                <ext:Model ID="Model1" runat="server" IDProperty="Id">
                                                                    <Fields>
                                                                        <ext:ModelField Name="Fecha" Type="Date" />
                                                                        <ext:ModelField Name="ExpedienteId" Type="String" />
                                                                        <ext:ModelField Name="ExpedienteNombre" Type="String" />
                                                                        <ext:ModelField Name="FaseNombre" Type="String" />
                                                                        <ext:ModelField Name="FaseId" Type="String" />
                                                                        <ext:ModelField Name="JefeturaNombre" Type="String" />
                                                                        <ext:ModelField Name="JefeturaCodigo" Type="String" />                                                               
                                                                    </Fields>
                                                                </ext:Model>
                                                            </Model>                                      
                                                            <Proxy>
                                                                <ext:PageProxy DirectFn="App.direct.BindDataEnviados">
                                                                    <Reader>
                                                                        <ext:JsonReader></ext:JsonReader>
                                                                    </Reader>
                                                                </ext:PageProxy>
                                                            </Proxy>
                                                        </ext:Store>
                                                    </Store>
                                                    <ColumnModel ID="ColumnModel1" runat="server">
                                                        <Columns>
                                                            <ext:Column ID="Column2"  runat="server" Text="Id" DataIndex="Id" Flex="1" Hidden="true"/>
                                                            <ext:DateColumn ID="DateColumn1" runat="server" Text="Fecha" Width="95" DataIndex="Fecha" Format="dd-m-yy" />                                                        
                                                            <ext:Column ID="Column3"  runat="server" Text="Expediente" DataIndex="ExpedienteNombre" Flex="1"/>
                                                            <ext:Column ID="Column4"  runat="server" Text="Fase" DataIndex="FaseNombre" /> 
                                                                                                                     
                                                        </Columns>                                                    
                                                    </ColumnModel>  
                                                    <Features>
                                                            <ext:GridFilters runat="server" ID="GridFilters2" Local="true" MenuFilterText="Filtrar por">
                                                                <Filters>
                                                                    <ext:StringFilter DataIndex="ExpedienteNombre"  EmptyText="Nombre"/>
                                                                    <ext:StringFilter DataIndex="FaseNombre" EmptyText="Fase"/>
                                                                    <ext:DateFilter   DataIndex="Fecha" AfterText="Despues de" BeforeText="Antes de"  OnText="En" >
                                                                        <DatePickerOptions runat="server" TodayText="Ahora" />
                                                                    </ext:DateFilter>                                                            
                                                                   
                                                                </Filters>
                                                            </ext:GridFilters>
                                                    </Features>      
                                            </ext:GridPanel>
                                          
                          
                                </Items>
                       
                       <BottomBar>
                         <ext:StatusBar 
                                ID="StatusBar1" 
                                runat="server"
                                StatusAlign="Left">
                                <Items>                                
                                    <ext:ToolbarTextItem ID="ToolbarTextItem2" runat="server" Text="" Cls="ux-bold-text-item"  Margin="15"/>
                                </Items>
                            </ext:StatusBar>
                        </BottomBar>
           </ext:FormPanel>
                     <ext:FormPanel ID   ="FormPanel3" runat="server" Region="Center" Layout="Fit"     Title  ="Documentos Devueltos" 
                                    Icon ="NoteAdd" >
                            <Items>  
                                    <ext:GridPanel
                                                    ID="gpDevueltos"
                                                    runat="server"                                           
                                                    Height="90">
                                                       <Store>
                                                        <ext:Store ID="Store3" runat="server">
                                                            <Model>
                                                                <ext:Model ID="Model3" runat="server" IDProperty="Id">
                                                                    <Fields>
                                                                        <ext:ModelField Name="Fecha" Type="Date" />
                                                                        <ext:ModelField Name="ExpedienteId" Type="String" />
                                                                        <ext:ModelField Name="ExpedienteNombre" Type="String" />
                                                                        <ext:ModelField Name="FaseNombre" Type="String" />
                                                                        <ext:ModelField Name="FaseId" Type="String" />
                                                                        <ext:ModelField Name="JefeturaNombre" Type="String" />
                                                                        <ext:ModelField Name="JefeturaCodigo" Type="String" /> 
                                                                           <ext:ModelField Name="Tabla" Type="String" />
                                                                        <ext:ModelField Name="TablaId" Type="String" />                                                            
                                                                    </Fields>
                                                                </ext:Model>
                                                            </Model>                                      
                                                            <Proxy>
                                                                <ext:PageProxy DirectFn="App.direct.BindDataDevueltos">
                                                                    <Reader>
                                                                        <ext:JsonReader></ext:JsonReader>
                                                                    </Reader>
                                                                </ext:PageProxy>
                                                            </Proxy>
                                                        </ext:Store>
                                                    </Store>
                                                    <ColumnModel ID="ColumnModel3" runat="server">
                                                        <Columns>
                                                            <ext:Column ID="Column5"  runat="server" Text="Id" DataIndex="Id" Flex="1" Hidden="true"/>
                                                            <ext:DateColumn ID="DateColumn2" runat="server" Text="Fecha" Width="95" DataIndex="Fecha" Format="dd-m-yy" />                                                        
                                                            <ext:Column ID="Column7"  runat="server" Text="Expediente" DataIndex="ExpedienteNombre" Flex="1"/>
                                                            <ext:Column ID="Column8"  runat="server" Text="Fase" DataIndex="FaseNombre" /> 
                                                            <ext:Column ID="Column10" runat="server">
                                                                <Commands>
                                                                    <ext:ImageCommand CommandName="RevApro" Icon="PageWhiteRefresh" Text="Documentos">                                                                
                                                                    </ext:ImageCommand>
                                                                </Commands>
                                                               
                                                                <Listeners>
                                                                    <Command Handler="pgFn.ShwoAllDoc(record);"></Command>
                                                                </Listeners>
                                                            </ext:Column>  
                                                            <ext:Column ID="Column9" runat="server">
                                                                <Commands>
                                                                    <ext:ImageCommand CommandName="RevApro" Icon="ApplicationEdit" Text="Asignar">                                                                
                                                                    </ext:ImageCommand>

                                                                </Commands>
                                                               
                                                                <Listeners>
                                                                    <Command Handler="pgFn.ShowProc(record);"></Command>
                                                                </Listeners>
                                                            </ext:Column>  
                                                          <ext:Column ID="Column13" runat="server">
                                                                <Commands>
                                                                    <ext:ImageCommand CommandName="VerExp" Icon="ZoomOut" Text="Ver Expediente">                                                                
                                                                    </ext:ImageCommand>
                                                                </Commands>
                                                               
                                                                <Listeners>
                                                                    <Command Handler="pgFn.ShowExp(record);"></Command>
                                                                </Listeners>
                                                            </ext:Column>                                                                                                  
                                                        </Columns>                                                    
                                                    </ColumnModel> 
                                                    <Features>
                                                            <ext:GridFilters runat="server" ID="GridFilters3" Local="true" MenuFilterText="Filtrar por">
                                                                <Filters>
                                                                    <ext:StringFilter DataIndex="ExpedienteNombre"  EmptyText="Nombre"/>
                                                                    <ext:StringFilter DataIndex="FaseNombre" EmptyText="Fase"/>
                                                                    <ext:DateFilter   DataIndex="Fecha" AfterText="Despues de" BeforeText="Antes de"  OnText="En" >
                                                                        <DatePickerOptions runat="server" TodayText="Ahora" />
                                                                    </ext:DateFilter>                                                            
                                                                   
                                                                </Filters>
                                                            </ext:GridFilters>
                                                    </Features>         
                                                </ext:GridPanel>
                                                  
                          
                            </Items>
                       
                           <BottomBar>
                             <ext:StatusBar 
                                    ID="StatusBar3" 
                                    runat="server"
                                    StatusAlign="Left">
                                    <Items>                                
                                        <ext:ToolbarTextItem ID="ToolbarTextItem3" runat="server" Text="" Cls="ux-bold-text-item"  Margin="15"/>
                                    </Items>
                                </ext:StatusBar>
                            </BottomBar>
               </ext:FormPanel>
              </Items>
            </ext:TabPanel>
            </Items> 
         </ext:FormPanel>
        </Items>
       </ext:Viewport>
    </form>
    <ext:XScript ID="XScript1" runat="server">
        <script type="text/javascript">
            var pgFn = new Object();
            pgFn.ShwoAllDoc= function (record) {
                try 
                { 
                    App.direct.ShowAllFiles(record.data.TablaId,record.data.Tabla,{
                        success: function (result) {
                           
                        },
                        eventMask: {
                            showMask: true,
                            minDelay: 500
                        }
                    });
                }
                catch (jsbug){
                    AppGlobalJs.showBug("pgFn.ShwoAllDoc: " + jsbug);
                }
            }; 
            pgFn.ShowExp = function (record) {
                try
                {    
                    AppGlobalJs.mostrarVentanaUrl('../../Expedientes/pgEditExpediente.aspx?id='+record.data.ExpedienteId,'Expediente '+record.data.ExpedienteNombre,'#ApplicationFormAdd');
                
                } catch (jsbug) {
                    AppGlobalJs.showBug("pgFn.ShowExp: " + jsbug)
                }
            };    
            pgFn.ShowProc = function (record) {
                try
                { 
                    #{forPanelProc}.getForm().loadRecord(record); 
                    AppGlobalJs.showWin(#{winProceso});

                } catch (jsbug) {
                    AppGlobalJs.showBug("pgFn.ShowProc: " + jsbug)
                }
            };   
             
       </script>
    </ext:XScript>     
</body>


</html>
